package com.yisu.auction.manager.core.service.impl;

import com.yisu.auction.ewf.common.web.EasyUIGrid;
import com.yisu.auction.ewf.entity.Member;
import com.yisu.auction.manager.core.mapper.MemberMapper;
import com.yisu.auction.manager.core.service.IMemberService;
import com.yisu.auction.manager.domain.request.memberPackage.MemberRequest;
import com.yisu.auction.manager.domain.vo.baseInfoPackageVos.MemberVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * author: 赵杰
 * Business Description： 会员业务接口实现
 * createTime：2017/8/21
 */
@Service
public class MemberServiceImpl extends BaseService implements IMemberService {
    @Resource
    private MemberMapper memberMapper;

    /**
     * author:赵杰
     * Business Description : 分页获取会员信息
     *
     * @param memberRequest 分页请求信息
     * @return 商品分类列表
     */
    @Override
    public EasyUIGrid<MemberVo> getMemberInfoByPage(MemberRequest memberRequest) {
        List<MemberVo> members = memberMapper.getMemberInfoByPage(memberRequest);
        EasyUIGrid<MemberVo> gridData = new EasyUIGrid<>();
        gridData.setTotal(memberRequest.getTotalRecords());
        gridData.setRows(members);
        return gridData;
    }

    /**
     * author:赵杰
     * Business Description : 获取所有用户信息
     *
     * @param memberRequest
     * @return
     */
    @Override
    public List<MemberVo> getAllMemberInfos(MemberRequest memberRequest) {
        return memberMapper.getAllMemberInfos(memberRequest);
    }
}
